﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Game.model;
using java.util;

namespace Game.ai
{
    public class GuardRuins:Fighter
    {
        public GuardRuins(NpcInstance actor):base(actor)
	    {
		    //super;
	    }
	
	   
	    protected override bool thinkActive()
	    {
		    NpcInstance actor = getActor();
		    if (actor.isDead())
		    {
			    return false;
		    }
		    List around = actor.getAroundNpc(500, 300);
		    if ((around != null) && !around.isEmpty())
		    {
			    foreach (NpcInstance npc in (IEnumerable)around)
			    {
				    if (npc.isMonster() && (npc.getNpcId() != 19153) && (npc.getNpcId() != 19152))
				    {
					    actor.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, npc, 300);
				    }
			    }
		    }
		    return true;
	    }
	    protected override void onEvtAttacked(Creature attacker, int damage)
	    {
		    if ((attacker == null) || attacker.isPlayable())
		    {
			    return;
		    }
		    base.onEvtAttacked(attacker, damage);
	    }
    }
}
